import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],

  build: {
    outDir: "packages/libs",
    lib: {
      entry: path.resolve(__dirname, 'packages/src/index.tsx'),
      name: 'ReactLibs',
      fileName: (format) => `react-libs.${format}.js`
    },
    rollupOptions: {
      // 确保外部化处理那些你不想打包进库的依赖
      external: ['react'],
      
    }
  }
})
